package operation.command;

import java.util.Set;
import java.util.TreeSet;

import operation.command.abs.ICommand;
import operation.command.obj.App;
import operation.command.obj.Light;
import operation.command.obj.LightOffCommand;
import operation.command.obj.LightOnCommand;

public class Client {
    public static void main(String[] args) {
        // Receiver
        Light light = new Light();

        // Commands, 绑定命令的接收者
        ICommand lightOnCommand = new LightOnCommand(light);
        ICommand lightOffCommand = new LightOffCommand(light);

        // 命令的发送者
        App app = new App();
        app.setCommand(0, lightOnCommand, lightOffCommand);
        System.out.println("press on ");
        app.pressOn(0);
        System.out.println("press off");
        app.pressOff(0);
        System.out.println("undo");
        app.pressUndo();
    }
}
